package com.xinongbest.mall.controller;

import com.xinongbest.mall.common.ApiRestResponse;
import com.xinongbest.mall.service.TranslateService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/translate")
public class TranslateController {
    @Resource
    TranslateService translateService;

    @PostMapping("/chToEn")
    public ApiRestResponse<String> chToEn(@RequestBody String json) {
        String translateResult = translateService.translateApi(json);
        return ApiRestResponse.success(translateResult);
    }
}
